
 <div id="boxpathpage" style="margin:0px;">
    	
    	<div><img src="images/home.png" width="24" height="24" style="margin-right:5px;" align="left" />
        <div style="padding-top:7px;">{pathpage}</div>
        </div>
</div>
     <div style="clear:both; height:10px;"></div>
      <!--START BLOCK : msg -->
		<div>
		{msg}		</div>
        <div style="clear:both; height:10px;"></div>
		<!--END BLOCK : msg -->
  
    
    
    <!-- START BLOCK : addnewitem -->
    <!-- add new item -->
    <div id="titlepage">
        	<div style="float:left"><img src="images/folder-add1.png" width="24" height="24" align="absmiddle" style="margin-right:5px;" />Thêm mới bài viết</div>
    </div>
    <div style="clear:both"></div>
    <table width="100%" border="0" class="tableadmin">
    <!-- addnew category form -->
	    <tr>
	      <td width="150"  colspan="2" style="padding:10px;">
          <div id="borderform" style="width:800px;">
         
          <form  name="form1" method="post" action="?page={par_page}&code=02" id="addnewitem" onsubmit="return check_null_addnew_item()">
	        <table width="800" border="0" align="center" cellpadding="0" cellspacing="0" class="tableadmin" >
	          <tr class="titletable">
	            <th colspan="2">&nbsp;</th>
	            </tr>
	          <tr>
	            <td width="150"><strong>Tên menu</strong></td>
	            <td><input type="text" name="name" id="name" class="textbox" value="{name}" /> <input type="checkbox" name="autoname" id="autoname" value="1" checked="checked" />
              Tự lấy tên</td>
	            </tr>
	          <tr>
	            <td><strong>Kiểu menu</strong></td>
	            <td><select name="type_menu" id="type_menu" style="width:150px" onChange="showcatmenu123($(this).attr('value'));">
            	 <option value="">&nbsp;None</option>
             	<option value="news">&nbsp;Tin tức</option>
               <option value="products">&nbsp;Sản phẩm</option>
                <option value="info">&nbsp;Nội dung</option>
               
                <option value="home">&nbsp;Trang chủ</option>
              <option value="contact">&nbsp;Liên hệ</option>
             
	         </select>
             <input type="hidden" name="idcategory" id="idcategory" value="" /></td>
	            </tr>
	          
	          <tr>
	            <td><strong>Linh đếm mục</strong></td>
	            <td><div id="showcatmenu1"></div></td>
              </tr>
	          <tr>
	            <td><strong>Là menu con</strong></td>
	            <td>{parentid}</td>
              </tr>
	          <tr>
	            <td><strong>Link</strong></td>
	            <td><input type="text" readonly="readonly" id="link" name="link" style="width:500px; border:solid #cccccc 1px" /></td>
              </tr>
	          <tr>
	            <td><strong>Vị trí menu</strong></td>
	            <td>
      <ul id="list_location">
                	<li><input type="checkbox" name="vitri[inmenubar]" id="inmenubar" value="menubar" />
    			<label for="inmenubar"> Menu bar</label></li>
		    <li><input type="checkbox" name="vitri[menuleft]" id="menuleft" value="menuleft" />
    <label for="menuleft"> Menu trái</label></li>
   					 <li><input type="checkbox" name="vitri[inhome]" id="inhome" value="inhome" />
    <label for="inhome"> Hiển thị ở trang chủ</label></li>
    					<li><input type="checkbox" name="vitri[menufooter]" id="menufooter" value="menufooter" />
    <label for="menufooter"> Menu footer</label></li>
   						
                </ul>
               </td>
              </tr>
	          <tr>
	            <td><strong>Thứ tự</strong></td>
	            <td><input type="text" name="thu_tu" id="thu_tu" class="orderbox" value="{thu_tu}"/></td>
	            </tr>
	          <tr>
	            <td><strong>Kích hoạt</strong></td>
	            <td><input type="checkbox" name="active" id="active" checked="checked" value="1"/></td>
	            </tr>
	          <tr>
	            <td>&nbsp;</td>
	            <td><input type="submit" name="button2" id="button2" value="Chấp nhận" class="btnadmin"/>
                <input name="cancel" type="button" value="Bỏ qua" onclick="window.location='?page={par_page}&pid={pid}&code=00'" class="btnadmin"/>
                </td>
	            </tr>
	          </table>
              <script language="javascript">
              		
						function check_null_addnew_item(){
							if($('#addnewitem #name').val()==''){
								alert('Bạn phải nhập vào tên bài viết');
								$('#addnewitem #name').focus();
								return false;								
							}
						}
					
              </script>
	        </form>
            </div>
          </td>
	      
      </tr>
           <!--end  addnew category form -->
      
</table>
    <div style="clear:both; height:5px;"></div>
    <!-- END BLOCK : addnewitem -->
    
    
    
    <!-- START BLOCK : edititem -->
    <!-- add new item -->
    <div id="titlepage">
        	<div style="float:left"><img src="images/folder-add1.png" width="24" height="24" align="absmiddle" style="margin-right:5px;" />Sửa chữ {item_name}</div>
    </div>
    <div style="clear:both"></div>
    <table width="100%" border="0" class="tableadmin">
   
	    <tr>
	      <td width="150"  colspan="2" style="padding:10px;">
          <div id="borderform" style="width:800px;">
          
          <form  name="form1" method="post" action="?page={par_page}&code=04&id={id_menu}" id="addnewitem" onsubmit="return check_null_addnew_item()" enctype="multipart/form-data">
	        <table width="800" border="0" align="center" cellpadding="0" cellspacing="0" class="tableadmin" >
	          <tr class="titletable">
	            <th colspan="2">&nbsp;</th>
	            </tr>
	          <tr>
	            <td width="150"><strong>Tên menu</strong></td>
	            <td><input type="text" name="name" id="name" class="textbox" value="{name}" /> <input type="checkbox" name="autoname" id="autoname" value="1" checked="checked" />
              Tự lấy tên</td>
	            </tr>
	          <tr>
	            <td><strong>Kiểu menu</strong></td>
	            <td><select name="type_menu" id="type_menu" style="width:150px" onChange="showcatmenu123($(this).attr('value'));">
            	 <option value="" {}>&nbsp;None</option>
             	<option value="news" {news}>&nbsp;Tin tức</option>
               <option value="products" {products}>&nbsp;Sản phẩm</option>
                <option value="info" {info}>&nbsp;Nội dung</option>
               
                <option value="home">&nbsp;Trang chủ</option>
              <option value="contact">&nbsp;Liên hệ</option>
             
	         </select>
             <input type="hidden" name="idcategory" id="idcategory" value="" /></td>
	            </tr>
	          
	          <tr>
	            <td><strong>Linh đếm mục</strong></td>
	            <td><div id="showcatmenu1"></div></td>
              </tr>
	          <tr>
	            <td><strong>Là menu con</strong></td>
	            <td>{parentid}</td>
              </tr>
	          <tr>
	            <td><strong>Link</strong></td>
	            <td><input type="text" readonly="readonly" id="link" name="link" style="width:500px; border:solid #cccccc 1px" value="{link}" /></td>
              </tr>
	          <tr>
	            <td><strong>Vị trí menu</strong></td>
	            <td>
      <ul id="list_location">
                	<li><input type="checkbox" name="vitri[inmenubar]" id="inmenubar" value="menubar" {inmenubar} />
    <label for="inmenubar"> Menu bar</label></li>
			     <li><input type="checkbox" name="vitri[menuleft]" id="menuleft" value="menuleft" {menuleft}/>
    <label for="menuleft"> Menu trái</label></li>
   					 <li><input type="checkbox" name="vitri[inhome]" id="inhome" value="inhome" {inhome}/>
    <label for="inhome"> Hiển thị ở trang chủ</label></li>
    					<li><input type="checkbox" name="vitri[menufooter]" id="menufooter" value="menufooter" {menufooter}/>
    <label for="menufooter"> Menu footer</label></li>
    		
                </ul>
               </td>
              </tr>
	          <tr>
	            <td><strong>Thứ tự</strong></td>
	            <td><input type="text" name="thu_tu" id="thu_tu" class="orderbox" value="{thu_tu}"/></td>
	            </tr>
	          <tr>
	            <td><strong>Kích hoạt</strong></td>
	            <td><input type="checkbox" name="active" id="active" checked="checked" value="1"/></td>
	            </tr>
	          <tr>
	            <td>&nbsp;</td>
	            <td><input type="submit" name="button2" id="button2" value="Chấp nhận" class="btnadmin"/>
                <input name="cancel" type="button" value="Bỏ qua" onclick="window.location='?page={par_page}&pid={pid}&code=00'" class="btnadmin"/>
                </td>
	            </tr>
	          </table>
              <script language="javascript">
              		
						function check_null_addnew_item(){
							if($('#addnewitem #name').val()==''){
								alert('Bạn phải nhập vào tên bài viết');
								
								$('#addnewitem #name').focus();
								return false;								
							}
						}
					
              </script>
	        </form>
            </div>
          </td>
	      
      </tr>
           <!--end  addnew category form -->
      
</table>
    <div style="clear:both; height:5px;"></div>
    <!-- END BLOCK : edititem -->
    
    
    <!-- end new item -->
  
    
         <!-- item -->
        <div id="titlepage">
        	<div style="float:left"><img border="0" src="images/docs.png" width="24" height="24" align="absmiddle" style="margin-right:5px;" />Danh sách bài viết</div>
            <div id="btnaddnewitem"><a href="?page={par_page}&code=01&pid={pid}&pitem={pitem}">Thêm mới {item_name} </a></div>
        </div>
        
         <div  style="clear:both"></div>
		</form>
         </div>
         <form action="?page={par_page}&code=06" method="post">
   	  <table width="100%" border="0" id="tablelist1">
       	
     <thead>
     
        <tr class="searchbar">
            <th width="36"><input name="" type="checkbox" value=""  class="checkallitem" /></th>
            <th width="452">
                <div style="float:left; ">&nbsp;Tên {item_name}</div>
                
            </th>
            <th width="159">Vị trí hiển thị</th>
            <th width="114">Kiểu menu</th>
            <th width="79">Kích hoạt</th>
            <th width="70">Thứ tự</th>
            <th width="46">Sửa</th>
            <th width="55">Xóa</th>
        </tr>
	</thead>

    	<!-- START BLOCK : list_menu -->
          <tr>
            <td align="center"><input name="" type="checkbox" value="" class="selectitem"/></td>
            <td><a href="{link_edit}">{image}&nbsp;{name}</a></td>
            <td width="159" align="center">{vitri}</td>
            <td width="114" align="center">{type_menu}</td>
            <td width="79" align="center"><input name="active_{id_menu}" type="checkbox" value="1" {active}/></td>
            <td width="70" align="center"><input type="text" style="width:60" name="thu_tu_{id_menu}" id="thu_tu" class="orderbox" value="{thu_tu}"/></td>
            <td align="center"><a href="?page={par_page}&code=03&id={id_menu}&pid={parentid}"><img border="0" src="images/tools.png" /></a></td>
            <td align="center"><a href="javascript:ConfirmDeleteItem({id_menu})"><img src="images/trash.png" border="0" /></a></td>
          </tr>
        <!-- END BLOCK : list_menu -->
        
          <tr class="bottomtable" >
            <th align="center"><input name="" type="checkbox" value=""  class="checkallitem" /></th>
            <th align="left"><a href="#" class="name">
            <div class="delall" style="float:left"><img src="images/icon_16_trash.png" border="0" align="absmiddle" style="margin-right:5px" />Xóa những mục đã chọn</div></a></th>
            <th colspan="4" align="center"><input type="submit" class="btnadmin" name="button" id="button" value="Cập nhật" /></th>
            <th align="center">&nbsp;</th>
            <th>&nbsp;</th>
          </tr>

        </table>
        </form>
         <div id="pagebar" align="center">
         	<div style="margin:0 auto; text-align:center">{pages_items}</div>
         </div>
		<div id="bottomtable"></div>
        <!-- end item -->
      
    <!-- end table -->
<script language="javascript">
		
function ConfirmDeleteCat(id)
 {
 	if(confirm('Bạn có thật sự muốn xóa không ?')){
		document.location='?page={par_page}&pid={pid}&p={p}&code=06&id='+id;
	}
	else	{
		return false;
	}
 }
 function ConfirmDeleteItem(id)
 {
 	if(confirm('Bạn có thật sự muốn xóa không ?')){
		document.location='?page={par_page}&pid={pid}&pitem={pitem}&code=05&id='+id;
	}
	else	{
		return false;
	}
 }

 <!-- START BLOCK : offsetupload -->
		$(document).ready(function () {	
				var offset = $('#btnuploadshowhere').offset();
				$('#uploadform').offset({ top: offset.top, left: offset.left });
				$('#newupload1').click(function(){
					$('#uploadform').show();
					if($('#newupload1').attr('checked')){
						var jqxhr = $.getJSON('index4.php?page=uploadfile',
						{
							delfile: "1",
							small_image: $('#small_image').val(),
							normal_image: $('#normal_image').val(),
							image: $('#image').val()
						});
						$('#files tr').remove();								
						$('#newupload1').attr('checked','');
						$('#newupload').hide();
					}
				});
				
			});
  <!-- END BLOCK : offsetupload -->
</script>


<div></div>
<script type="text/javascript">
//$('#showcatmenu1').load("index4.php?page=showcatmenu&lang={lang}&type_menu="+$('#type_menu').val());
	
		
		function confirmdelitem(id){
			if (confirm('Ban that su muon xoa '))
			{
				document.location="?page=sr_menu&code=05&id="+id;
			}
		}
	
		function showcatmenu123(abc){
				$('#showcatmenu1').load("index4.php?page=showcatmenu&lang={lang}&type_menu="+abc);
		}
		function showlink(showlink){
			
				$('#link').attr('value',showlink);		
				strreplate($('#showcatmenu option:selected').text());	
				
				$('#idcategory').attr('value',$('#showcatmenu option:selected').attr('title'));

			
		}
		function strreplate(text){
			if($('#autoname').attr('checked')){
				if($('#showcatmenu option:selected').text()=='&nbsp;Root' || $('#showcatmenu option:selected').text=='&nbsp;'){
					$('#name').attr('value',$('#type_menu option:selected').text());		
					
				}else{
					var str=text;
					var a=str.replace("-", "");
					a=a.replace("-", "");
					a=a.replace("-", "");
					a=a.replace("-", "");
					a=a.replace(/^\s+|\s+$/g,"");
					$('#name').attr('value',a);
				}
			}
			
		}
		$('#name').keypress(function() {
			
		  $('#autoname').attr('checked', false);
		});
    $(document).ready(function() {
		//	$('#showcatmenu1').load("index4.php?page=showcatmenu&lang={lang}&type_menu="+$('#type_menu').val());

			
	});
    </script>